package com.gxa.p2p.controller;

import com.gxa.p2p.common.JsonResult;
import com.gxa.p2p.pojo.Organ;
import com.gxa.p2p.service.OrganService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author ：looker
 * 担保机构controller
 * @date ：Created in 2021/10/26 11:22
 */
@CrossOrigin
@RestController
@RequestMapping("/Organ")

//@Transactional
@Api(value = "担保机构的操作的接口")
public class OrganController {

    @Autowired
    OrganService organService;

    /**
     * 担保机构名全查询
     * @return
     */
    @PostMapping("/findAll")
    @ApiOperation("查询担保机构的全部信息")
    public Map findAll(){
        JsonResult jsonResult = new JsonResult();
        List<Organ> all = organService.findAll();
        jsonResult.setCode("1");
        jsonResult.setData(all);
        return jsonResult.getDataMap();
    }
}
